package pers.li.controller.goods;


import pers.li.model.VO.GoodsVO;
import pers.li.service.GoodsService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/goods/goodsDetail.action")
public class GoodsController extends HttpServlet {
    private final GoodsService goodsService = new GoodsService();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Integer goods_id = Integer.parseInt(req.getParameter("goods_id"));
        GoodsVO goodsVO = goodsService.getGoodsVO(goods_id);
        req.setAttribute("goodVO",goodsVO);
        req.getRequestDispatcher("/goods/goods_detail.jsp").forward(req,resp);
    }
}
